package com.xr.miniprogram.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.xr.miniprogram.domain.MiniProgramUserAddress;

import java.util.List;

public interface IMiniProgramUserAddressService extends IService<MiniProgramUserAddress> {

    /**
     * 根据用户id 查询用户地址列表
     * @param miniProgramUserId
     * @return
     */
    List<MiniProgramUserAddress> queryUserAddressList(Long miniProgramUserId);

    /**
     * 根据用户地址di 查询用户地址
     * @param miniProgramUserAddressId
     * @return
     */
    MiniProgramUserAddress queryUserAddressById(Long miniProgramUserAddressId);

    /**
     * 根据用户id 查询用户默认地址
     * @param userId
     * @return
     */
    MiniProgramUserAddress defaultAddress(Long userId);

    /**
     * 更新或保存用户地址
     * @param miniProgramUserAddress
     * @return
     */
    boolean saveOrUpdateAddress(MiniProgramUserAddress miniProgramUserAddress);

    /**
     * 更改默认地址
     * @param miniProgramUserAddress
     * @return
     */
    boolean changeDefault(MiniProgramUserAddress miniProgramUserAddress);
}
